Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

[WIP] record history from pushState and replaceState #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chrmod
Copy link
Member

@chrmod chrmod commented Mar 21, 2018

This little trick is likely to work as it is battle tested by firefox-ios project:
https://github.com/mozilla-mobile/firefox-ios/blob/2d5ca06880b9288be74b7eb1a6cb7c937292387d/Client/Frontend/UserContent/UserScripts/MainFrame/AtDocumentStart/HistoryStateHelper.js

Unfortunately on Android (not sure about iOS), using onMessage on a web view breaks certain pages, like twitter.com, it is probably caused by a fact Android web view replaces native postMessage https://github.com/facebook/react-native/blob/0.39-stable/React/Views/RCTWebView.m#L286

@chrmod
Copy link
Member Author

chrmod commented Mar 21, 2018

@chrmod
Copy link
Member Author

chrmod commented Mar 24, 2018

Have found react-native PR that implemented webview messaging facebook/react-native@abb8ea3 and it looks like the original window.postMessage function gets replaced with react-native one, which means, the messages never arrive to their original destinations. I will try to fix that by calling original function along with react-native replacement.

@chrmod
Copy link
Member Author

chrmod commented Mar 24, 2018

OK. Have implemented react-native bugfix. This PR has to be merged before we can progress facebook/react-native#18546

@chrmod chrmod closed this Apr 1, 2018
@chrmod chrmod deleted the history-push-state branch April 1, 2018 15:02
@chrmod chrmod restored the history-push-state branch April 1, 2018 15:02
@chrmod chrmod reopened this Apr 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant